<template>
  <div class="app-container" :class="{ 'monitor-page': $route.path === '/monitor' }">
    <el-container>
      <el-header>
        <div class="header-content">
          <h1 class="app-title">数据同步管理系统</h1>
          <el-menu
            mode="horizontal"
            :router="true"
            :default-active="$route.path"
            class="app-menu"
          >
            <el-menu-item index="/sync">
              <el-icon><Plus /></el-icon>
              新建同步
            </el-menu-item>
            <el-menu-item index="/tasks">
              <el-icon><List /></el-icon>
              任务管理
            </el-menu-item>
            <el-menu-item index="/monitor">
              <el-icon><Monitor /></el-icon>
              监控面板
            </el-menu-item>            
            <el-menu-item index="/template">
              <el-icon><Setting /></el-icon>
              元数据管理
            </el-menu-item>
          </el-menu>
        </div>
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script setup>
import { Plus, List, Setting, Monitor } from '@element-plus/icons-vue'
</script>

<style>
.app-container {
  min-height: 100vh;
}

.el-header {
  background-color: #fff;
  border-bottom: 1px solid #e6e6e6;
  padding: 0;
  height: 60px;
  line-height: 60px;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 100%;
}

.app-title {
  margin: 0;
  font-size: 20px;
  margin-right: 40px;
  color: #409EFF;
  white-space: nowrap;
}

.app-menu {
  flex: 1;
  justify-content: flex-start;
  border-bottom: none;
}

.el-menu--horizontal > .el-menu-item {
  padding: 0 20px;
}

.el-menu-item [class^="el-icon"] {
  margin-right: 5px;
  vertical-align: middle;
}

.el-main {
  background-color: #f5f7fa;
  padding: 0;
}

/* 监控页面特殊样式 */
.monitor-page .el-main {
  background-color: #000;
  padding: 0;
  overflow: hidden;
}

.monitor-page .el-container {
  height: 100vh;
}

.monitor-page {
  overflow: hidden;
}
</style> 